package model.entity.product;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import model.entity.role.Users;

@Entity
@Table(name = "Suggestion")
public class Suggestion {

	private int suggestionId;
	private Users user;
	private String title;
	private String conntent;
	private Date dateCreate;
	private String suggestImage;

	public Suggestion() {
	}

	public Suggestion(int suggestionId, Users user, String title,
			String conntent, Date dateCreate) {
		this.suggestionId = suggestionId;
		this.user = user;
		this.title = title;
		this.conntent = conntent;
		this.dateCreate = dateCreate;
	}

	public Suggestion(int suggestionId, Users user, String title,
			String conntent, Date dateCreate, String suggestImage) {
		this.suggestionId = suggestionId;
		this.user = user;
		this.title = title;
		this.conntent = conntent;
		this.dateCreate = dateCreate;
		this.suggestImage = suggestImage;
	}

	@Id
	@GeneratedValue(generator = "Suggestion_ID_Gen", strategy = GenerationType.IDENTITY)
	@SequenceGenerator(name = "Suggestion_ID_Gen", sequenceName = "Suggestion_SEQ_ID")
	@Column(name = "SuggestionID", unique = true, nullable = false)
	public int getSuggestionId() {
		return this.suggestionId;
	}

	public void setSuggestionId(int suggestionId) {
		this.suggestionId = suggestionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UserID", nullable = false)
	public Users getUser() {
		return this.user;
	}

	public void setUser(Users user) {
		this.user = user;
	}

	@Column(name = "Title", nullable = false)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "Conntent", nullable = false)
	public String getConntent() {
		return this.conntent;
	}

	public void setConntent(String conntent) {
		this.conntent = conntent;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DateCreate", nullable = false, length = 23)
	public Date getDateCreate() {
		return this.dateCreate;
	}

	public void setDateCreate(Date dateCreate) {
		this.dateCreate = dateCreate;
	}

	@Column(name = "SuggestImage")
	public String getSuggestImage() {
		return this.suggestImage;
	}

	public void setSuggestImage(String suggestImage) {
		this.suggestImage = suggestImage;
	}

}
